#ifndef GUI_MDIVIEW_H_H_H_
#define GUI_MDIVIEW_H_H_H_
#include "View.h"
#include <QMainWindow>



 namespace Gui 
 {
	 class BaseView;
	 class Gui_Document;
 };


 class  MDIView : public QMainWindow, public Gui::BaseView
{
    Q_OBJECT;

    TYPESYSTEM_HEADER();


public:
    /** View constructor
     * Attach the view to the given document. If the document is zero
     * the view will attach to the active document. Be aware, there isn't
     * always an active document.
     */
    MDIView(Gui::Gui_Document* pcDocument, QWidget* parent, Qt::WFlags wflags=0);
    /** View destructor
     * Detach the view from the document, if attached.
     */
    ~MDIView();

    /// get called when the document is updated
    virtual void onRelabel(Gui::Gui_Document *pDoc);
    virtual void viewAll();

    /// Message handler
    virtual bool onMsg(const char* pMsg,const char** ppReturn);
    /// Message handler test
    virtual bool onHasMsg(const char* pMsg) const;
    /// overwrite when checking on close state
    virtual bool canClose(void);
    /// delete itself
    virtual void deleteSelf();
    /// print function of the view
    virtual void print();
    virtual void printPdf();

    QSize minimumSizeHint () const;

    /// MDI view mode enum
    enum ViewMode {
        Child,      /**< Child viewing, view is docked inside the MDI application window */  
        TopLevel,   /**< The view becomes a top level window and can be moved outsinde the application window */  
        FullScreen  /**< The view goes to full screen viewing */
    };
    /**
     * If \a b is set to \a FullScreen the MDI view is displayed in full screen mode, if \a b
     * is set to \a TopLevel then it is displayed as an own top-level window, otherwise (\a Normal)
     * as tabbed window. For more hints refer to the Qt documentation to
     * QWidget::showFullScreen ().
     */
    virtual void setCurrentViewMode(ViewMode mode);
    ViewMode currentViewMode() const { return currentMode; }

Q_SIGNALS:
    void message(const QString&, int);

protected Q_SLOTS:
    /** This method gets called from the main window this view is attached to
     * whenever the window state of the active view changes.
     * The default implementation does nothing.
     */
    virtual void windowStateChanged(MDIView*);

protected:
    void closeEvent(QCloseEvent *e);
    /** \internal */
    void changeEvent(QEvent *e);

private:
    ViewMode currentMode;
    Qt::WindowStates wstate;
};

//} // namespace Gui

#endif // GUI_MDIVIEW_H 

